package com.hkemmm.shop.service.impl;

import com.hkemmm.shop.dao.GoodsMapper;
import com.hkemmm.shop.dao.Goods_categoryMapper;
import com.hkemmm.shop.dao.Goods_imgMapper;
import com.hkemmm.shop.entity.Category;
import com.hkemmm.shop.entity.Goods;
import com.hkemmm.shop.entity.Goods_category;
import com.hkemmm.shop.entity.Goods_img;
import com.hkemmm.shop.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService implements IGoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Autowired
    private Goods_imgMapper imgMapper;

    @Override
    public List<Goods> getGoods(Integer number) {
        return goodsMapper.getGoods(number);
    }

    @Override
    public Goods selectByPrimaryKey(Integer id) {
        return goodsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Goods_img> getListImg(Integer id) {
        return imgMapper.getListImg(id);
    }

    @Override
    public List<Goods> getRelatedGoods(List<Category> list) {

        return goodsMapper.getRelatedGoods(list);
    }

    @Override
    public List<Goods> getAllGoods(Integer shopId) {
        return goodsMapper.getAllGoods(shopId);
    }

    @Override
    public int insertSelective(Goods record) {
        return goodsMapper.insertSelective(record);
    }

    @Override
    public int updateByPrimaryKeySelective(Goods record) {
        return goodsMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int delGoods(Integer id,Integer status) {
        return goodsMapper.delGoods(id,status);
    }


}
